using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace MechaShark
{
    class Enemy
    {
        public Model Model;
        public Matrix currentWorld;
        public Matrix currentView;
        public Matrix currentProj;
        public float cameraDistance = 70;
        public float speed = 0;
        public bool IsHurt;

        public float Arc = 90;
        public float Rotation = 90;
        public float Distance = 100;

        public int Health;
        public float xpos;
        public float ypos;
        public float DistToMove;

        public Enemy(Model model, float x, float y, float Speed, int health, float distToMove)
        {
            speed = Speed;
            Model = model;
            xpos = x;
            ypos = y;
            Health = health;
            IsHurt = false;
            DistToMove = distToMove;
        }
        public void EnemyHurt(int damage)
        {
            IsHurt = true;
            Health -= damage;
        }
        public void moveEnemy(GraphicsDevice Device, GameTime gameTime)
        {
            float time = (float)gameTime.ElapsedGameTime.TotalMilliseconds;

            xpos += speed * time * 0.10f;

            currentWorld = Matrix.CreateRotationY(MathHelper.ToRadians(90)) *
            Matrix.CreateRotationX(MathHelper.ToRadians(0)) *
            Matrix.CreateRotationZ(MathHelper.ToRadians(0)) *
            Matrix.CreateTranslation(xpos, ypos, 0);

            currentView = Matrix.CreateRotationY(MathHelper.ToRadians(0)) *
            Matrix.CreateRotationX(MathHelper.ToRadians(0)) *
            Matrix.CreateTranslation(0, 0, -cameraDistance);

            currentProj = Matrix.CreatePerspectiveFieldOfView(MathHelper.Pi / 4,
                                                                    Device.Viewport.AspectRatio,
                                                                    1,
                                                                    1000);
        }
    }
}
